package com.chentf.srb.core;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author chentengfei
 * @desc 启动类
 * @date 2021-10-31 18:29:47
 */
@SpringBootApplication
@ComponentScan({"com.chentf.srb", "com.chentf.common"})
public class ServiceCoreApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext run = SpringApplication.run(ServiceCoreApplication.class, args);
        String port = run.getEnvironment().getProperty("server.port");
        String serviceName = run.getEnvironment().getProperty("spring.application.name");
        System.out.println("启动端口为:"+port+",启动服务名为:"+serviceName);
    }
}
